package com.ken.android.music.data;

import com.ken.android.music.db.MusicDao;
import com.ken.android.music.model.MusicBean;
import com.ken.android.music.view.MyApplication;

import java.util.List;

public class MusicDataRepository {

    private static MusicDataRepository mRepository;

    public static Object lock = new Object();

    public static MusicDataRepository get(){
        if(mRepository == null){
            synchronized (lock){
                if(mRepository == null){
                    mRepository = new MusicDataRepository();
                }
            }
        }
        return mRepository;
    }
    public List<MusicBean> getTotalLocalMusic(){
        return MusicDao.get().getAllMusic(MyApplication.getApplication());
    }

    public void scanLocal(){
        MusicDao.get().scanMusic(MyApplication.getApplication());
    }
}
